package seguranca.model;
// Generated Oct 23, 2014 7:15:00 PM by Hibernate Tools 4.3.1


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TbMissao generated by hbm2java
 */
@Entity
@Table(name="tb_missao"
    ,catalog="bd_prototipo"
)
public class TbMissao  implements java.io.Serializable {


     private Integer idtMissao;
     private TbEndereco tbEndereco;
     private String dscMissao;
     private Date dtaInicioMissao;
     private Date dtaFimMissao;
     private Set<TbRequisicao> tbRequisicaos = new HashSet<TbRequisicao>(0);

    public TbMissao() {
    }

	
    public TbMissao(TbEndereco tbEndereco, String dscMissao, Date dtaInicioMissao, Date dtaFimMissao) {
        this.tbEndereco = tbEndereco;
        this.dscMissao = dscMissao;
        this.dtaInicioMissao = dtaInicioMissao;
        this.dtaFimMissao = dtaFimMissao;
    }
    public TbMissao(TbEndereco tbEndereco, String dscMissao, Date dtaInicioMissao, Date dtaFimMissao, Set<TbRequisicao> tbRequisicaos) {
       this.tbEndereco = tbEndereco;
       this.dscMissao = dscMissao;
       this.dtaInicioMissao = dtaInicioMissao;
       this.dtaFimMissao = dtaFimMissao;
       this.tbRequisicaos = tbRequisicaos;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="idt_missao", unique=true, nullable=false)
    public Integer getIdtMissao() {
        return this.idtMissao;
    }
    
    public void setIdtMissao(Integer idtMissao) {
        this.idtMissao = idtMissao;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="cod_endereco", nullable=false)
    public TbEndereco getTbEndereco() {
        return this.tbEndereco;
    }
    
    public void setTbEndereco(TbEndereco tbEndereco) {
        this.tbEndereco = tbEndereco;
    }

    
    @Column(name="dsc_missao", nullable=false, length=200)
    public String getDscMissao() {
        return this.dscMissao;
    }
    
    public void setDscMissao(String dscMissao) {
        this.dscMissao = dscMissao;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="dta_inicio_missao", nullable=false, length=10)
    public Date getDtaInicioMissao() {
        return this.dtaInicioMissao;
    }
    
    public void setDtaInicioMissao(Date dtaInicioMissao) {
        this.dtaInicioMissao = dtaInicioMissao;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="dta_fim_missao", nullable=false, length=10)
    public Date getDtaFimMissao() {
        return this.dtaFimMissao;
    }
    
    public void setDtaFimMissao(Date dtaFimMissao) {
        this.dtaFimMissao = dtaFimMissao;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="tbMissao")
    public Set<TbRequisicao> getTbRequisicaos() {
        return this.tbRequisicaos;
    }
    
    public void setTbRequisicaos(Set<TbRequisicao> tbRequisicaos) {
        this.tbRequisicaos = tbRequisicaos;
    }




}


